package com.imooc.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("jz")
@RefreshScope       // 动态刷新的注解
public class JiaoZiController {

    @Autowired
    private JiaoZiService jiaoZiService;

    /**
     * 链路表示
     * 第一条链路：father -> 吃饺子
     * 第二条链路：son    -> 吃饺子
     */

    @GetMapping("/father")
    public Object father() {
        jiaoZiService.eatJiaoZi();
        return "ok~";
    }

    @GetMapping("/son")
    public Object son() {
        jiaoZiService.eatJiaoZi();
        return "ok~";
    }


}
